/* 
 * File:   ImageInverter.cpp
 * Author: Guilherme Monteiro
 * 
 */

#include "../headers/ImageColorInverter.h"

ImageColorInverter::ImageColorInverter() {
}

ImageColorInverter::ImageColorInverter(const ImageColorInverter& orig) {
}

ImageColorInverter::~ImageColorInverter() {
}

/**
 * Swap the colors (black and white)
 * of a binary image.
 * 
 * @param img: source image
 * @return binary image inverted
 */
IplImage* ImageColorInverter::invert(IplImage* image) {
    IplImage* imageReversed = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 1);
    cvThreshold(image, imageReversed, 0, 255, CV_THRESH_BINARY_INV);
    return imageReversed;
}

